/**
 *
 */
package com.ybkj.daijia.server.service.impl;

import com.ybkj.daijia.server.mapper.GasRebateMapper;
import com.ybkj.daijia.server.model.GasRebate;
import com.ybkj.daijia.server.service.GasRebateService;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * @author Shine
 */
@Service
public class DefaultGasRebateService implements GasRebateService {

    @Autowired
    private GasRebateMapper gasRebateMapper;


    @Transactional(rollbackFor = Exception.class)
    public GasRebate save(GasRebate gasRebate) {

        gasRebateMapper.insertRecord(gasRebate);

        return gasRebate;

    }

    @Transactional(rollbackFor = Exception.class)
    public void update(GasRebate memberRebate) {

        gasRebateMapper.updateByPrimaryKey(memberRebate);

    }

    @Override
    public GasRebate findOne(Long id) {
        return gasRebateMapper.selectByPrimaryKey(id);
    }


    @Override
    public List<GasRebate> findAll() {
        return gasRebateMapper.selectAll();
    }

    @Override
    public GasRebate findByCompany(Long companyId) {
        return gasRebateMapper.selectByCompany(companyId);
    }


}